Image forming device using multiple factors to adjust print position

ABSTRACT

According to the type of paper sheet specified through an operation unit (111) by the user, the environmental temperature detected by a thermistor (110), and the spacing between the paper sheet and a paper sensor, detected by a lift height sensor (113), respectively, the correction values for the start and end positions where the printing heads start and end the printing in a horizontal direction are beforehand stored in a memory (112). Before printing, a CPU (104) detects the paper edge positions of the paper sheet on the basis of the output from a paper sensor (303), and reads the corresponding correction values from the memory (112) according to the type of paper sheet, the environmental temperature and the lift height. A window control unit (106) corrects the paper edge position with the correction values, thereby generating a window signal which controls the side margins of the paper sheet. In accordance with the window signal, a head control unit (105) controls the heads (103) for the respective colors to precisely determine printable regions extending horizontally from the printing start positions to the printing end positions.

TECHNICAL FIELD

The present invention relates to an image forming device, and particularto such a device comprising a recording head which is scanned in adirection perpendicular to the travelling direction of a recordingmedium.

BACKGROUND ART

One type of such image forming devices is a device which employs an inkjet recording system. In the ink jet recording system, a nozzle filledwith ink from an ink tank is provided with a heater which is heated inresponse to a heating pulse signal to thereby produce an air bubble, thepressure of which acts to eject an ink drop from the nozzle. In an imageforming device employing the ink jet recording system, a plurality ofnozzles are disposed in a line to form a recording head which is scannedto record an image.

As shown in FIG. 9, a recording head 103 (hereinafter referred to assimply a head) mounted on a carriage is scanned in a main scanningdirection (X) to perform a printing on a paper sheet 15 column by column(17), so that a multitude of such columns are successively printed toachieve the printing of a band. Then, the paper sheet 15 is travelled ina sub-scanning direction (Y) to perform the printing of a second bandnext to the first band. This process is iterated so as to form an imageconstituted by the multitude of bands.

In recent years, a plurality of heads of different ink colors (e. g.,cyan, magenta, yellow and black, etc.) are used together so that thedifferent colors of ink are superimposed to form a full-color image. Thefull-color image requires printed positions of the respective colors(ink ejected positions) to be precise. For this purpose, usually asshown in FIG. 10, a linear scale 301 having slits 304 for every dotposition formed therealong and a linear sensor 302 for opticallydetecting the presence/absence of the slit are used for providing thesynchronization for ejecting ink drops, while counting pulse outputs(corresponding to the slits) from the linear sensor 302 for calculatinga distance travelled by the head, thereby recognizing the exactpositions to be printed on.

Also, the presence/absence of a paper sheet is detected with a papersensor 303 which is mounted near the heads. As shown in FIG. 11, thepaper sensor 303 is scanned on a paper sheet together with a carriage120. When the paper sensor sequentially detects the left and right edgesof the paper sheet, slit-count values are read out which are obtained bycounting the output pulses from the linear sensor 302 and whichcorrespond to the respective distances travelled from a referenceposition, thereby recognizing where in the horizontal direction and whatsize of paper sheet has been loaded. For such a paper sensor 303,usually a light-reflection type sensor is used which emits lightoutwardly and detects any reflected light.

In the present specification, the left and right edges of the papersheet correspond respectively to the left and right sides when viewedfrom the upstream of the transfer of the paper sheet. Thus, it should benoted that the left and right are opposite to those when viewed from thefront of the device.

In forming an image on a paper sheet, the print start and end positions,i.e., margins in the horizontal direction, are determined according to acurrent position of the paper sensor 303 and the respective heads, basedon the position of the paper sheet (count values of the slits of thelinear scale 301), taking into consideration a margin from the paperedge Pe and distances of the respective heads from the paper sensor. Forexample, in FIG. 11, suppose that "A" is a distance between the paperedge position Pe and the paper sensor 303 at the reference position andan amount of margin Z is to be obtained. Then, when the paper sensor 303reaches a position Pk of [A+Z+X] the printing is started with the K head(black head being the first one in the printing direction). Then, whenthe paper sensor 303 reaches a position Pc of [A+Z+X+Y1] the printing isstarted with the C head (cyan head being the second one in the printingdirection). Further, when the paper sensor 303 reaches a position Pm of[A+Z+X+Y1+Y2] the printing is started with the M head (magenta headbeing the third one in the printing direction). Likewise, when the papersensor 303 reaches a position Py of [A+Z+X+Y1+Y2+Y3] the printing isstarted with the Y head (yellow head being the fourth one in theprinting direction). In this way, adequate margins are ensured and theprint start positions of the heads are controlled to be at the sameposition (Ps).

When performing two-way printing, the similar control also applies tothe back path.

Instead of the combination of the linear scale 301 and the linear sensor302, an alternative means to determine the image start position at theedge of a paper sheet can be realized by counting moving steps of amotor which drives the carriage 20 to move in the X direction.

In the meantime, paper (recording medium) includes normal paper, coatedpaper, film paper, intermediate paper (tracing paper), etc. and thelight reflectance differs depending upon the characteristics of thepaper. Now, assume that as shown in FIG. 12, a fixed threshold level(represented by a dashed line) Th is used for a binary conversion todetect a paper sheet with respect to an output from the light reflectivetype paper sensor 303. In this case, the output level of the sensor willvary depending upon the magnitude of the reflectance. For example, ascompared to the sensor output Son with respect to the normal paper whichexhibits a normal level of reflectance, the sensor output Sol for paperof a lower reflectance will decrease in its output level. This resultsin that the binary signal Bl for the paper of the lower reflectance willrise later than the binary signal Bn of the sensor output for the normalpaper. Opposite to this, the binary signal Bh for the paper of a higherreflectance will rise earlier than the binary signal Bh for the paper ofthe normal reflectance. As a result, as shown in FIG. 13, the printstart position in the horizontal direction X (main scanning direction ofthe head 103) for the lower reflectance paper (FIG. 13(b)) will be aheadof that of the normal paper (FIG. 13(a)), and the print start positionin the horizontal direction X for the higher reflectance paper (FIG.13(c)) will be behind of that of the normal paper. This will cause themargins Z1, Z2 and Z3 from the paper edge Pe to the print startpositions to vary depending upon the type of paper. In this way,inaccurately detected position of the paper edge affects the accuracy ofthe margins.

Even when the same type of paper is used, the sensor output level willvary with an ambient temperature depending upon the temperaturecharacteristics of the receiving element of the sensor. This can makethe detected position of the paper edge incorrect, changing the margins.

Further, some types of paper could swell and heave as the print densityincreases, causing the heads to rasp the surface of the paper sheet. Toovercome this, there is a device of a type in which a user canarbitrarily adjust the spacing between the heads and the paper sheet. Inthis type of the device, the paper sensor 303, which is mounted near theheads, will change in its height together with the heads. Thus, thechange of the spacing between the paper sheet and the paper sensor 303will cause the amount of incident light of the sensor to vary, changingits output level so that the detected position of the paper edge becomesinaccurate to change the margins.

It is, therefore, an object of the present invention to provide an imageforming device capable of accurately detecting a paper edge positioneven when states of events change, which causes an output deviation of arecording medium detection means such as a paper sensor.

It is another object to provide an image forming device capable ofaccurately defining a horizontal margin by accurately detecting a paperedge position.

DISCLOSURE OF THE INVENTION

According to the invention, there is provided an image forming devicecomprising a carriage for mounting thereon a recording head, thecarriage being scanned in a direction perpendicular to a travellingdirection of a recording medium; a recording medium detection means fordetecting a side edge of the recording medium, based on a change in adetected output when scanned in the direction perpendicular to thetravelling direction of the recording medium; an event state detectionmeans for detecting a state of an event which is a factor fluctuatingthe output of the recording medium detection means; a correction valuestorage means for storing correction values to correct the output ofsaid recording medium detection means based on different states of theevent detected by said event state detection means; a correction meansfor, when recording with the recording head, obtaining one of thecorrection values corresponding to a state of the event detected by theevent detection means, from the correction value storage means, and forcorrecting, with the correction value, the output from the recordingdetection means.

The recording medium detection means, for example, includes a detectorwhich emits light outward and outputs an electrical signal responsive toan amount of reflected light and a binary conversion circuit whichconverts an output of the detector into a binary signal.

The event state detection means, for example, may be means for detectingan ambient temperature of the image forming device.

Alternatively, the event state detection means may be means fordetecting a type of the recording medium which is set up by a user.Instead, it may also be means for detecting a spacing between therecording medium and the detector.

The image forming device, preferably, further includes a margin controlmeans for controlling, when scanning the recording head in the directionperpendicular to the travelling direction of the recording medium, amargin in the head scanning direction by defining at least a print startposition, the margin control means controlling the margin based on theoutput of the recording medium detection means corrected by thecorrection means.

The detector may be fixedly mounted on the carriage. This allows thedetector to scanned together with the scanning of the carriage,eliminating the need of a mechanism dedicated to scan the detector.

The image forming device according to the invention may also includemeans for adjusting a spacing between the carriage and the recordingmedium. With this means, in a case where a plurality of heads aremounted on the carriage, an adjustment can be achieved so that all therespective spacings between the heads and the recording medium areequally adjusted. In this case, the spacing between the detector and therecording medium also changes at the same time. According to theinvention, even when a change occurs in the state of the type of paper,the ambient temperature, the spacing between the recording medium andthe detector, etc., it is possible to accurately detect a paper edgeposition and at least start a printing with an accurate margin.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing a configuration of an ink-type imageforming device as an embodiment according to the invention;

FIG. 2 shows a mechanism for moving a carriage of the embodiment, with aschematic perspective view and an expanded view of the carriage mountedon the mechanism;

FIGS. 3(a), 3(b) and 3(c) are graphs showing an output of a papersensor, which changes depending upon various factors: a reflectance of apaper sheet, an ambient temperature, a lift height, respectively.

FIGS. 4(a), 4(b) and 4(c) shows examples of correction amounts for ahorizontal printing position with respect to various factors as shown inFIGS. 3(a), 3(b) and 3(c): the ambient temperature, the type of paperand the lift height, respectively;

FIG. 5 shows how print start/end timings of a head in the horizontaldirection are corrected with respect to the various factors as shown inFIG. 3(a), 3(b) and 3(c);

FIG. 6 is a diagram showing specifically print start/end timings of thehead in the horizontal direction;

FIG. 7 is a diagram of a circuit which generates print start/end timingsof the head in a main scanning direction (horizontal direction) in theembodiment;

FIG. 8 is a diagram of a circuit which processes an output signal from apaper sensor in the embodiment;

FIG. 9 is a diagram for explaining a prior art method of printing;

FIG. 10 is a diagram showing an arrangement of a linear scale, slits anda paper sensor in prior art;

FIG. 11 is a diagram which shows print start timings of respective headsof plural colors;

FIG. 12 is a diagram for explaining the characteristics of the papersensor and problems in a prior art ink-type image forming device;

FIG. 13 shows a printed result of the prior art inktype image formingdevice;

FIG. 14 is a flow chart showing a process of detecting a paper edge inthe embodiment; and

FIG. 15 is a flow chart showing a printing process in the embodiment.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

Now, the present invention will be described in detail with reference tothe illustrated embodiment. The same numerals are used for elementssimilar to those described hereinbefore and the duplicate explanationwill be omitted.

In the embodiment, as one of image forming devices, there is explainedan ink jet image forming device with a plurality of color heads.However, the invention is not limited to this, but is applicable to anytype of image forming device if the device has a head, which is scannedin the direction perpendicular to the paper travelling direction, and asensor to detect a side edge position of a paper sheet (the output ofwhich varies depending upon a type of paper).

FIG. 1 is a block diagram showing a configuration of the ink jet imageforming device according to the embodiment. FIG. 2 shows a perspectiveview of a main part of a carriage moving mechanism of the image formingdevice and an expanded view of a recording head unit of the mechanism.

As shown in FIG. 1, the image forming device is generally divided intothree parts: an external device 101, such as an image scanner, apersonal computer, a CAD device, etc. which outputs image data VDI beingan image to be recorded, a print control unit 102 for producing signalsnecessary for forming an image on a recording medium based on the imagedata VDI which are transferred from the external device 101, and a head103 for perform a printing based on the signals from the print controlunit 102.

The print control unit 102 includes a CPU 104, a head control unit 105,a window control unit 106, a binary conversion circuit 107, an imagememory 108, a memory 112, etc. The CPU 104 provides an interface withthe external device 101, and controls the entire operation of the printcontrol unit 102 including the image memory 108, the memory 112 andI/O's. The CPU 104 also monitors outputs from a lift height sensor 113,a thermistor 110, and communicates with the head 103 and an operationunit 111. The window control unit 106 performs an operation explainedbelow in response to an output signal LINSCL of the linear sensor 302.The binary conversion circuit 107, responsive to an output signal Sofrom the paper sensor 303, performs the binary conversion. The CPU 104detects the side edge position of the paper sheet based on the binaryconverted output.

As shown in FIG. 2, the linear scale 301 is fixed to the main body ofthe image forming device and a carriage 120 is provided movably back andforth along the linear scale 301. At the left side of the carriage 120,a paper sensor 303 is mounted which acts to detect a side edge of apaper sheet. The carriage 120 has four heads 103 mounted thereon, fromthe side of the paper sensor 303, in the order of K (black), C (cyan), M(magenta) and Y (yellow). Numeral 111 indicates an operation unit beingan interface with a user, with which the user can arbitrarily issuecommands for selecting a print mode, exchanging a head, for performingan ink clogging recovery, specifying a type of paper, etc. Theinstruction from the operation unit 111 is recognized by the CPU 104,which in turn transfers the instructed operation to the heads 103 andthe head control unit 105.

Along the scanning direction X of the carriage 120, a pair of rails 305and 306 are disposed in parallel. At the bottom of the carriage 120, twoguide members 233 are fixed along the direction perpendicular to therail 306, so that the guide members 233 are supported slidably along therail 306 back and forth in the scanning direction X. Disposed on theguide members is the carriage 120, a lever 113a on which is movableleftward or rightward so as to change the height of the carriage 120relative to the guide member 233 in a Z direction in three steps ofupper, medium and lower. Numeral 113 indicates a lift height sensorwhich detects how far the heads 103 on the carriage 120 are away from apaper sheet. The lift height sensor 113 can be constituted by a volumeresistor, a detector switch or the like which is operated by the motionof the lever 113a. On the upper surface of the carriage 120, athermistor 110 is placed to detect an ambient (environmental)temperature. By monitoring the detected result of the thermistor 110, itis recognized at what degree of temperature the image forming device isnow operated and by what amount the temperature has risen or fallenrelative to the previous temperature.

In FIG. 2, M1 indicates a motor for driving the carriage 120 in the Xdirection and M2 indicates another motor for moving a paper sheet 15 inthe Y direction.

FIGS. 3(a), 3(b) and 3(c) are graphs representing an output So of thepaper sensor 303 with respect to a reflectance Rf of paper, an ambienttemperature Temp, and a lift height Lhght of the heads, respectively. Asshown in FIG. 3(a), the stronger is the light reflected from a papersheet (higher reflectance of the paper sheet), the higher is the outputof the paper sensor. Similarly, as shown in FIG. 3(b), the higher is theambient temperature, the higher is the paper sensor output. Also, asshown in FIG. 3(c), the greater is the lift height of the heads, thelower is the paper sensor output.

Therefore, when converting the paper sensor output into a binary signalwith a fixed threshold level, the detected position of the paper edgevaries as described above (see FIGS. 12 and 13(a)-(c)), and hence, theprint start position will vary depending upon the type of paper, theambient temperature and the lift height. To overcome this, there areprovided the thermistor 110 for detecting the ambient temperature, theoperation unit 111 for a user to set up a type of paper, and a liftheight sensor 113 for detecting the lift height of the heads, asmentioned above, so as to perform a control of correcting the printstart position based on the ambient temperature, the type of paper andthe lift height.

In the present embodiment, as shown in FIG. 4, conversion tables 401,402 and 403 are placed in the memory 112 (FIG. 1), which respectivelystore a correction amount Ct (FIG. 4(a)) for correcting open/closetimings of window signals (mentioned below) which are generated by thewindow control unit 106 in response to a variation amount of the ambienttemperature, a correction amount Cp (FIG. 4(b)) for correcting the samein response to the type of paper, and a correction amount Ch (FIG. 4(c))for correcting the same in response to the lift height. In the exampleshown in FIG. 4, with respect to the ambient temperature, correctionamounts from -8 dots to 2 dots are prepared at 9 steps from 0 degree to40 degrees at an interval of 5 degrees. With respect to the type ofpaper, correction amounts from +4 dots to -4 dots are prepared at aninterval of 2 dots, for 5 types of paper. Further, with respect to thelift height, correction amounts from +4 dots to -4 dots are prepared atan interval of 4 dots, at three steps as mentioned above. The numbers ofthe steps and the values of the correction amount are given only by wayof example and therefore the present invention is not limited to thesespecific numbers and values. In addition, instead of providing theconversion tables 401, 402 and 403 which store therein the correctionamounts, the correction amounts can be embedded beforehand in a programfor executing the print process (explained below), as parameters whichcorrespond to various conditions.

Responsive to the detected temperature from the thermistor 110, the typeof paper designated from the operation unit 111, and the output from thelift height sensor 113, the CPU 104 corrects the data, which determineink-eject start/end positions for each head 103, to be set in the CPUI/F unit 802 (FIG. 7) of the window control unit 106 (mentioned below).Thus, as shown in FIG. 5, the window signals WIND 0-3 of the respectiveheads K, C, M and Y are corrected in their timings so as to modify theprint start/end positions (as indicated by the arrows directed rightwardand leftward). (In FIG. 5, MCNT indicates a count value of the pulseoutput from the linear sensor 302.) As a result, proper margins can bemaintained in spite of the variation of the ambient temperature, thetype of paper and the lift height. More specifically, at the left edgeof a paper sheet, when the ambient temperature is low, when the paperreflectance is low and when the lift height is high, the correction isperformed so as to make the rising and falling timings of the respectivewindows earlier. Reversely, when the ambient temperature is high, whenthe paper reflectance is high and when the lift height is low, thecorrection is performed so as to make the rising and falling timings ofthe respective windows later. Likewise, at the right side edge of thepaper sheet, the correction is made in the opposite direction for therespective cases. This is because the detection error occurs in theopposite direction, at the left and right edges of the paper sheet. Thatis, when the left side paper edge is detected at an inner position thanthe actual paper edge position, the right side edge position is alsodetected at an inner position than the actual position.

In the embodiment, both the left and right paper edges are detected foran image forming device capable of handling an indefinite size of paper.However, if only definite sizes of paper are handled, it may besufficient to detect only the paper edge at one side.

Now, an operation of the embodiment will be explained below, dividing itinto (1) a general operation of the device and (2) detailed operationsof the respective units.

(1) General Operation of The Ink-type Image Forming Device

Referring to FIG. 1, upon receipt of serial image data VDI from theexternal device 101, the head control unit 105 temporarily storesseveral bands of the serial image data VDI into the image memory 108 inresponse to an instruction from the CPU 104. The stored image data VDIare subjected to various image processing and then image data VDO areoutput in synchronism with the scanning of the heads 103.

By using the signal LINSCL which is output in synchronism with thescanning of the heads 103 from the linear sensor (302 in FIG. 10) movingalong the linear scale 301, the synchronization of outputting the imagedata VDO is maintained while the travelled distance of the heads 103 areoutput by a counter (801 in FIG. 7) in the window control unit 106,which will be explained next.

The window control unit 106 generates window signals (area signals) WIND0-4 (see FIG. 6) each indicating a printable region from the print startposition to the print end position, and makes a synchronization signalvalid only within the enabled region of the window signal. These signalsWIND 0-4 are generated as follows. The CPU 104 sets up the start and endpositions for the respective heads 103, taking into consideration thespacings between the mounted positions thereof, and performs a controlso that when the travelled distances of the respective heads from areference position reach positions set by the CPU, the respectivesignals WIND 0-4 are enabled.

The head control unit 105 also generates signals necessary for ejectingink drops, such as signals BENB 0-7 for enabling blocks in each head(eight block enable signals are present in the embodiment since 128nozzles of each head are divided into eight blocks) and heater drivingpulse signals HENB. These signals are known and not directly relevant tothe invention, and hence, the details will not described here.

The image data VDO, the block enable signals BENB 0-7 and the heaterdriving pulse signals MENB from the head control unit 105 aretransferred to each head 103, where the control circuit in the head 103drives ON the heaters of only the nozzles whose image data VDO andenable signals (BNEB, HENB) are enabled to eject ink drops onto a papersheet, forming a column of image and then forming a band of image byscanning the heads 103 in the main scanning direction X as mentionedabove (see FIG. 9).

In the embodiment, a full color printing is realized by using four setsof the head control unit 105 and the head 103, with cyan, magenta,yellow and black ink tanks (each ink tank is integrated with therespective head in this embodiment). (In the description below, anexplanation will be given only with respect to one set of them.) Asexplained above, the heads 103 and the paper sensor 303 (see FIG. 10)are scanned on a paper sheet. The output of the paper sensor 303 iscompared with a threshold level in the binary conversion circuit 107 tobe converted into a binary signal, based on which the CPU 104 decideswhether a paper sheet is present or absent. The CPU 104 monitors thebinary converted output of the linear sensor 302, while also monitoringthe count value of the output from the linear sensor 302, at the timethe paper sheet is detected, so as to recognize where in the horizontaldirection what size of paper sheet has been loaded. Further, in formingan image on the paper sheet, as mentioned above, based on the positionof the paper sheet (the count value of a pulse output from the linearsensor), the print start and end positions are determined according tothe present positions of the paper sensor 303 and each head 103, takinginto consideration a margin from the paper edge position Pe and thedistances of each head from the paper sensor 303.

Also as mentioned above, in order to prevent the heads to rasp thesurface of a paper sheet due to the swelling and heaving of the papersheet depending on a print density, the carriage 120, on which the headsare mounted, is provided with the lever 113a for switching the height ofthe heads 103 where the guide members 233, ganged with the motion of thelever 113a, cause the heads 103 to move up or down to change the heightof the heads. The height of the heads at that time is detected by thelift height sensor 113, which is then recognized by the CPU 104.

(2) Detailed Operation of the Respective Units

The above described window control unit 106, paper sensor 303,thermistor 110, operation unit 111 and lift height sensor 113 are theelements which perform the most characteristic operation in theinvention. With these elements, the paper edge position Pe detected bythe paper sensor 303 and the linear sensor 302 is corrected based on thetype of paper specified at the operation unit 111, the ambienttemperature detected by the thermistor 110, and the lift height detectedby the lift height sensor 113, thereby controlling the print start/endpositions according to the corrected result. This is, as stated above,to overcome the problem that the detected paper edge positionfluctuates, which displaces the print start position to change themargin, depending upon the type of paper, the ambient temperature andthe lift height.

An explanation will be given of each element hereinafter.

Referring to FIG. 7, there is shown a circuit diagram which representsthe configuration inside the window control unit 106. In FIG. 7, numeral801 denotes a multi-bit counter; numeral 802 denotes a CPU I/F unit;803-804, multi-bit comparators; 805-806, selectors; 807-808, two-bitcounters; 809-810, decoders; 811-818, AND circuits; and 819-822, J-Kflip-flops.

The multi-bit counter 801 counts, as a clock input, the pulse signalLINSCL from the linear sensor 302 which moves together with the heads103, and detects a travelled distance MCNT of the heads 103 from thereference position. The travelled distance MCNT is monitored through theCPU I/F unit 802 by the CPU 104.

Also, the CPU 104 stores, in the CPU I/F unit 802, data corresponding tothe ink eject start/end positions (i.e., open/close positions of thewindow) for each head. The selector 805 operates so as to sequentiallyselect the data indicative of the window open positions for therespective heads at predetermined regular intervals from the first headto the last (in the order of the inputs 0, 1, 2 and 3). Also, theselector 806 operates so as to sequentially select the data indicativeof the window close positions for the respective heads at predeterminedregular intervals from the first head to the last (in the order of theinputs 0, 1, 2 and 3). The data setting to the CPU I/F unit 802 isperformed in this manner. In the embodiment, since the heads are mountedin the order of black, cyan, magenta and yellow as mentioned above, thedata are set in this order.

As the printing is started and the heads 103 move, the travelleddistance MCNT outputted from the multi-bit counter 801 is compared, atthe multi-bit comparators 803 and 804, with the data of the ink ejectstart or end positions set in the CPU I/F unit 802 with respect to therespective heads. First, when the carriage 120 reaches the positionrepresented by the window open data which have been specified withrespect to the first head of black, a window open signal OPWIND becomeshigh "H", causing the 2-bit counter 807 to count up at the same time toupdate an open identifying signal OPCNT to "1H" (here, "H" indicates ahexadecimal). (The initial value of the 2-bit counter 807 is zero.)Thus, the input to the multi-bit comparator 803 is switched to the input1 of the selector 805 (data prepared for the second head), resulting inthat the window open signal OPWIND goes back to a low level "L".Subsequently, when the carriage 120 reaches the open position of thesecond head following the first head, the window open signal OPWINDbecomes high "H", causing the 2-bit counter 807 to count up to "2H", andthe input to the multi-bit comparator 803 to change to the input 2 ofthe selector 805 (data prepared for the third head). As a result, thewindow open signal OPWIND changes back to "L". Further, when thecarriage 120 reaches the open position of the third head, the windowopen signal OPWIND becomes high "H", causing the 2-bit counter 807 tocount up to "3H", and the input to the multi-bit comparator 803 tochange to the input 3 of the selector 805 (data prepared for the fourthhead). As a result, the window open signal OPWIND changes back to "L".

The window close signal CLWIND operates, when the carriage 120 comesnear the terminated edge of the paper sheet, together with the selector806 and the comparator 804 in the same manner as the window open signalOPWIND.

With the foregoing operations iterated, generated are the window opensignal OPWIND and the window close signal CLWIND, as well as the openidentifying signal OPCNT and close identifying signal CLCNT which aresignals for identifying which one of the four heads is to be opened orclosed. The identifying signals OPCNT and CLCNT are applied respectivelyto the decoder 809 and 810, and AND circuits 811-818. Thus, dependingupon the head identifying signal OPCNT and CLCNT, the open/close timingsignals are distributed to the respective heads. The timing signalsdistributed to the respective heads act to set and reset the J-Kflip-flops 819-822 as shown in FIG. 6, to generate the window signalsWIND 0-3 for the respective heads.

Referring next to FIG. 8, a detailed explanation will be given of thepaper sensor 303 and the binary conversion circuit 107. The paper sensor303 in the embodiment is a detector which photo-electrically detects thepresence of a paper sheet. In FIG. 8, numeral 1001 denotes a lightemitting unit which is constituted by a lamp or LED; numeral 1002denotes a light receiving unit which is constituted by aphoto-transistor or photo-diode; 1003, an emitter resistor; and 1004, acomparator. The light emitting unit 1001 emits light on to a paper sheetduring the scanning of the heads 103, and the reflected light isreceived by the light receiving unit 1002. The voltage generated at theend of the emitter resistor 1003 is converted with a threshold levelinto a binary signal at the comparator 1004, so as to detect thepresence/absence of a paper sheet. By monitoring the count value of thelinear sensor 302 (FIG. 10) at the time the presence/absence of thepaper sheet is detected, it is recognized where in the horizontaldirection what size of paper has been loaded.

FIG. 14 shows a flow chart of a paper edge detection process which isexecuted by the CPU 104. This paper edge detection process is a processwhich is executed prior to the starting of a new printing process (e.g.,a printing process of a document).

First, a paper sheet is loaded (S141) and then the paper sensor 303together with the carriage is started to move from the referenceposition in the main scanning direction X (S142). In this event, theoutput from the linear sensor 302 is counted by the multi-bit counter801 (FIG. 7) to wait until the left edge position of the paper sheet isdetected based on the output of the paper sensor 303 (S143). Upondetection of the left edge position of the paper sheet, data A from themulti-bit counter 801 at that time is read out to be stored in thememory 112 (FIG. 1) (S144). Then, the carriage 120 continues to moveuntil the right edge position of the paper sheet is detected based onthe output of the paper sensor 303 (S145). At the time the right edgeposition of the paper sheet is detected, data B from the multi-bitcounter 801 is read out to be stored in the memory 112 (S146).

Referring next to FIG. 15, there is shown a flow chart of a printingprocess which is executed by the CPU 104.

First, the completion of loading a paper sheet is waited (S151). Afterthe completion of the loading, the data A of the left edge position ofthe paper sheet is read out of the memory 112 (S152). Then, a marginamount Z is read out which has been designated by a user (S153). Thismargin amount Z has already been stored in the memory 112 at this pointof time. When the margin amount is to be different at the left and rightsides, separate margin amounts for the both sides are read out.

Subsequently, based on the type of paper which has been designated bythe user, a margin correction amount Cp, which is determined accordingto the relationship defined in FIG. 4(b), is read out of the table 402(S154). Then, based on the ambient temperature detected by thethermistor 110, a margin correction amount Ct, which is determinedaccording to the relationship defined in FIG. 4(a), is read out of thetable 401 (S155). Similarly, based on the lift height detected by thelift height sensor 113, a margin correction amount Ch, which isdetermined according to the relationship defined in FIG. 4(c), is readout of the table 403 (S156).

Next, a value is calculated from an equation, Q=A+Z+X+Cp+Ct+Ch, whichvalue is set in the CPU I/F unit 802 so as to assign the value to theinput 0 location of the selector 805 (S157). This value Q corresponds tothe print start position (window open position) of the black (B) head.The data A of the paper left edge position is corrected with a sum ofthe three correction values Cp+Ct+Ch, and hence, the designated marginamount is accurately realized.

Subsequently, values obtained by separately adding the Q value with a Chead correction amount Y1, an M head correction amount Y2, and a Y headcorrection amount Y3 (see FIG. 11) are set in the CPU I/F unit 802 sothat the values are assigned to the input 1, 2, 3 locations,respectively, of the selector 805 (S158-S160). These assigned valuescorrespond to the print start positions (window open positions) of theC, M and Y heads, respectively.

Then, the data B of the paper right edge position is read out (S161).Using this data B, a value is calculated from an equation,R=B-Z+X-Cp-Ct-Ch, which value is set in the CPU I/F unit 802 so as toassign the value to the input 0 location of the selector 806 (S162).Here, the correction amounts are subtracted unlike step S157 because thedetected error occurs in the opposite direction at the left and rightedge of the paper sheet, as mentioned above. The margin amount Z may bedifferent from the previous one, when separate margin amounts aredesignated at the left and right sides. The R value corresponds to theprint end position (window close position) of the black (B) head. Alsoin this case, the data B of the paper right edge position is correctedwith the sum of the three correction values Cp+Ct+Ch, and hence, thedesignated margin amount is accurately realized.

Subsequently, values obtained by separately adding the R value with theC head correction amount Y1, the M head correction amount Y2, and the Yhead correction amount Y3 (see FIG. 11) are set in the CPU I/F unit 802so that the values are assigned to the input 1, 2, 3 locations,respectively, of the selector 806 (S163-S165). These assigned valuescorrespond to the print end positions (window close positions) of the C,M and Y heads, respectively.

In this way, the setting of all the data to the CPU I/F unit 802 iscompleted. After this, a printing process is started (S166).

According to the invention, as described above, even any one of the typeof paper, the ambient temperature and the spacing from the paper sensorto the paper sheet varies, the paper edge position detected by the papersensor is corrected based on the respective information, thereby makingit possible to control the print start position so as to perform theprinting with a proper margin at any time.

INDUSTRIAL APPLICABILITY

The present invention is available to manufacture an image formingdevice which performs the printing while scanning a recording head in adirection perpendicular to the paper travelling direction.

What is claimed is:
 1. An image forming device, comprising:a carriagefor mounting thereon a recording head, said carriage being scanned in adirection perpendicular to a travelling direction of a recording medium;a scale means for defining recordable dot positions along a scanningdirection of said carriage; a sensor operable with said scale means fordetecting each dot position of said scale means; a counter means forcounting dots starting from a reference position based on an output ofsaid sensor moved in said scanning direction; a recording mediumdetection means including a light emitting element for emitting light tosaid recording medium, a light detector for outputting a signalcorresponding to an amount of reflected light of said light emitted fromsaid light emitting element, a binary conversion circuit for convertingan output of said light detector into a binary signal, and means forreading out a count value of said counter means to detect a side edge ofthe recording medium based on a change in an output of said binaryconversion circuit when said carriage is scanned in the directionperpendicular to the travelling direction of the recording medium; anevent state detection means for detecting a state of an event which is afactor fluctuating the output of said recording medium detection means;a correction value storage means for storing correction values tocorrect the read-out count value of said recording medium detectionmeans based on different states of the event detected by said eventstate detection means; and a correction means for, when recording withthe recording head, obtaining one of the correction values correspondingto a state of the event detected by said event detection means, fromsaid correction value storage means, and for correction, with thecorrection value, said read-out count value as a position of the sideedge of the recording medium obtained by said recording detection means.2. An image forming device according to claim 1, wherein said eventstate detection means comprises means for detecting an ambienttemperature of said image forming device.
 3. An image forming deviceaccording to claim 1, wherein said event state detection means comprisesmeans for detecting a type of the recording medium which is set up by auser.
 4. An image forming device according to claim 1, wherein saidevent state detection means comprises means for detecting a distancebetween the recording medium and said detector.
 5. An image formingdevice according to claim 1, comprising a margin control means forcontrolling, when scanning the recording head in the directionperpendicular to the travelling direction of the recording medium, amargin in the head scanning direction by defining at least a print startposition, said margin control means controlling the margin based on theoutput of said recording medium detection means corrected by saidcorrection means.
 6. An image forming device according to claim 1,wherein said detector is fixedly mounted on said carriage.
 7. An imageforming device according to claim 1, further comprising means foradjusting a distance between said carriage and the recording medium. 8.An image forming device according to claim 1, wherein said event statedetection means comprises means for detecting an ambient temperature ofsaid image forming device.
 9. An image forming device according to claim1, wherein said event state detection means comprises means fordetecting a type of the recording medium which is set up by a user. 10.An image forming device according to claim 1, comprising a margincontrol means for controlling, when scanning the recording head in thedirection perpendicular to the travelling direction of the recordingmedium, a margin in the head scanning direction by defining at least aprint start position, said margin control means controlling the marginbased on the output of said recording medium detection means correctedby said correction means.
 11. An image forming device according to claim2, comprising a margin control means for controlling, when scanning therecording head in the direction perpendicular to the travellingdirection of the recording medium, a margin in the head scanningdirection by defining at least a print start position, said margincontrol means controlling the margin based on the output of saidrecording medium detection means corrected by said correction means. 12.An image forming device according to claim 3, comprising a margincontrol means for controlling, when scanning the recording head in thedirection perpendicular to the travelling direction of the recordingmedium, a margin in the head scanning direction by defining at least aprint start position, said margin control means controlling the marginbased on the output of said recording medium detection means correctedby said correction means.
 13. An image forming device according to claim4, comprising a margin control means for controlling, when scanning therecording head in the direction perpendicular to the travellingdirection of the recording medium, a margin in the head scanningdirection by defining at least a print start position, said margincontrol means controlling the margin based on the output of saidrecording medium detection means corrected by said correction means. 14.An image forming device according to claim 1, wherein said detector isfixedly mounted on said carriage.
 15. An image forming device accordingto claim 2, wherein said detector is fixedly mounted on said carriage.16. An image forming device according to claim 3, wherein said detectoris fixedly mounted on said carriage.
 17. An image forming deviceaccording to claim 4, wherein said detector is fixedly mounted on saidcarriage.
 18. An image forming device according to claim 5, wherein saiddetector is fixedly mounted on said carriage.
 19. An image formingdevice according to claim 1, further comprising means for adjusting adistance between said carriage and the recording medium.
 20. An imageforming device according to claim 2, further comprising means foradjusting a distance between said carriage and the recording medium. 21.An image forming device according to claim 2, further comprising meansfor adjusting a distance between said carriage and the recording medium.22. An image forming device according to claim 3, further comprisingmeans for adjusting a distance between said carriage and the recordingmedium.
 23. An image forming device according to claim 4, furthercomprising means for adjusting a distance between said carriage and therecording medium.
 24. An image forming device according to claim 5,further comprising means for adjusting a distance between said carriageand the recording medium.
 25. An image forming device according to claim6, further comprising means for adjusting a distance between saidcarriage and the recording medium.